home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-20 / bb21tu.zip / INTERNAL.DOC < prev    next >
Text File  |  1991-07-20  |  25KB  |  423 lines

  1. This file contains documentation of file layouts.  Its intended for for
  2. programmers trying to write servers etc.  If you are just going to run
  3. the BBS, you can skip this!!!
  4.  
  5. When writing a server, try to keep to using IMPORT and EXPORT for
  6. getting messages in and out of the BBS.  This will allow you to contiue
  7. to run even after I change the file formats.
  8.  
  9. General types used elsewhere
  10. ----------------------------
  11.  
  12. CONST
  13.   call_sign_len = 6;
  14.   bb_addr_len   = 10;
  15.   h_addr_len    = 32;
  16.   bid_len       = 12;
  17.   password_len  = 8;
  18.   file_name_len = 80;
  19.   subj_len      = 128;
  20.  
  21. TYPE
  22.  
  23.   bb_addr_str   = STRING[bb_addr_len];
  24.   bb_full_addr  = STRING[call_sign_len + 1 + h_addr_len];
  25.   bid_str       = STRING[bid_len];
  26.   call_sign_str = STRING[call_sign_len];
  27.   file_name_str = STRING[file_name_len];
  28.   h_addr_str    = STRING[h_addr_len];
  29.   password_str  = STRING[password_len];
  30.   subj_str      = STRING[subj_len];
  31.  
  32.  
  33. MSG.BB
  34. ------
  35.  
  36. The file contains either one of two records per message.  The second
  37. record is needed to hold the distribution list.  The first record is garbage
  38. except for the record number.  That number is the version number of the file.
  39. It should be "2"
  40.  
  41. CONST
  42.  
  43.      msg_dist_max = 20;                 (* Max number of distribution list   *)
  44.      msg_path_max_msgs = 254;           (* Max messages per path.  Don't     *)
  45.                                         (* exceed 254.                       *)
  46.      msg_path_max_route = 30;           (* Max routes per path.  Don't exceed*)
  47.                                         (* 254                               *)
  48.  
  49. (*---------------------------------------------------------------------------*)
  50. (* These define bits in msg_d_flag                                           *)
  51. (*---------------------------------------------------------------------------*)
  52.  
  53. CONST
  54.   df_fwd         = $01;         (* Message has been forwarded                *)
  55.   df_fwd_select  = $02;         (* Message has been selected for forward     *)
  56.   df_fwd_process = $04;         (* Forward in process now                    *)
  57.   df_fwd_reject  = $08;         (* Bid was rejected                          *)
  58.   df_fwd_cancel  = $10;         (* Forward was cancelled by operator         *)
  59.   df_fwd_unknown = $20;         (* Unknown route                             *)
  60.  
  61. (*---------------------------------------------------------------------------*)
  62. (* These define bits in msg_flag                                             *)
  63. (*---------------------------------------------------------------------------*)
  64.  
  65. CONST
  66.  
  67.   mf_hold         = $0001;      (* Message is in hold                        *)
  68.   mf_read         = $0002;      (* Message has been read                     *)
  69.   mf_fwd          = $0004;      (* Message has been forwarded                *)
  70.   mf_fwd_select   = $0008;      (* Message has been selected for fwd         *)
  71.   mf_fwd_list     = $0010;      (* Distribution list attached                *)
  72.   mf_old          = $0020;      (* Message is old                            *)
  73.   mf_kill         = $0040;      (* Message has been killed                   *)
  74.   mf_fwd_process  = $0080;      (* Forward in process now                    *)
  75.   mf_review       = $0100;      (* Message for review by SYSOP               *)
  76.   mf_h_receive    = $0200;      (* Hierarchial route received                *)
  77.   mf_archive      = $2000;      (* Msg has been archived                     *)
  78.   mf_disrout      = $4000;      (* Distribution routing block present        *)
  79.   mf_unknown      = $8000;      (* Routed to ?                               *)
  80.  
  81. (*---------------------------------------------------------------------------*)
  82. (* Types                                                                     *)
  83. (*---------------------------------------------------------------------------*)
  84.  
  85. TYPE
  86.     msg_flag_type = WORD;
  87.  
  88.     (* ----- This is the individual distribution list entries ------------- *)
  89.  
  90.     msg_dist_entry_type = RECORD
  91.               msg_d_flag    : BYTE;         (* Flags for this item          *)
  92.               msg_d_info    : bb_addr_str;  (* Where to forward to          *)
  93.             END;
  94.  
  95.     msg_dist_block_type = RECORD
  96.               msg_d_no      : BYTE;         (* No of items                  *)
  97.               msg_d_array   : ARRAY[1..msg_dist_max] OF msg_dist_entry_type;
  98.             END;
  99.  
  100.     (* ----- This is the file format -------------------------------------- *)
  101.  
  102.  
  103.     msg_block = RECORD
  104.               msg_number  : WORD;           (* This msg number               *)
  105.               msg_type    : CHAR;           (* Type of msg -- list is below  *)
  106.               msg_flag    : msg_flag_type;  (* Flags                         *)
  107.               msg_size    : LONGINT;        (* Message size                  *)
  108.               msg_to      : call_sign_str;  (* To addressee                  *)
  109.               msg_to_at   : bb_addr_str;    (* To mailbox address            *)
  110.               msg_to_h    : h_addr_str;     (* To hierarchial route          *)
  111.               msg_from    : call_sign_str;  (* From                          *)
  112.               msg_from_at : bb_addr_str;    (* From mailbox                  *)
  113.               msg_from_h  : h_addr_str;     (* From hierarchial route        *)
  114.               msg_dt_in   : LONGINT;        (* Message's date time at here   *)
  115.               msg_dt_orig : LONGINT;        (* Message's date time at origin *)
  116.               msg_no_orig : WORD;           (* Message number at origin      *)
  117.               msg_tread   : BYTE;           (* Times read (except sysops)    *)
  118.               msg_bid     : bid_str;        (* Message bid                   *)
  119.               msg_r_call  : call_sign_str;  (* Call sign of reject station   *)
  120.               msg_reason  : BYTE;           (* Reason for hold/review        *)
  121.               msg_subj    : subj_str;       (* Subject                       *)
  122.             END;
  123.  
  124.  
  125. USER.BB
  126. -------
  127.  
  128. The file contains one record per user.  The first record is garbage
  129. except for the first word.  That number is the version number of the
  130. file.  It should be "2"
  131.  
  132. (*---------------------------------------------------------------------------*)
  133. (* These define bits in user_flag                                            *)
  134. (*---------------------------------------------------------------------------*)
  135.  
  136. CONST
  137.  
  138.   user_f_trans    = $0001;     (* User is transparent                        *)
  139.   user_f_bbs      = $0002;     (* User is a BBS                              *)
  140.   user_f_abbs     = $0004;     (* User is an advanced BBS                    *)
  141.   user_f_sysop    = $0008;     (* User can be a remote sysop                 *)
  142.   user_f_adrchg   = $0010;     (* User has updated his home BBS              *)
  143.   user_f_exclude  = $0020;     (* User is excluded                           *)
  144.   user_f_delete   = $0040;     (* User record is empty                       *)
  145.   user_f_local    = $0080;     (* User is a local                            *)
  146.   user_f_emerg    = $4000;     (* User is allowed on during emergencies      *)
  147.   user_f_pbbs     = $8000;     (* User is a personal BBS                     *)
  148.  
  149. TYPE
  150.     user_class_type =
  151.                      (user_c_nu,         (* New user                         *)
  152.                       user_c_uu,         (* Unregistered user                *)
  153.                       user_c_ou,         (* Old user                         *)
  154.                       user_c_eu,         (* Expert user                      *)
  155.                       user_c_bu,         (* BBS user                         *)
  156.                       user_c_rsu,        (* Remote sysop user                *)
  157.                       user_c_lsu);       (* Local sysop user                 *)
  158.  
  159.     user_record_type = RECORD
  160.                          user_i_ptr  : user_index_ptr;  (* Pointer to index  *)
  161.                          user_id     : call_sign_str;   (* Call sign of user *)
  162.                          user_ssid   : ssid_sign_str;   (* SSID of user      *)
  163.                          user_name   : STRING[20];      (* User's name       *)
  164.                          user_bbs    : bb_addr_str;     (* Mail address      *)
  165.                          user_zip    : STRING[10];      (* Zip code          *)
  166.                          user_port   : CHAR;            (* User's port       *)
  167.                          user_class  : user_class_type; (* User class        *)
  168.                          user_flag   : WORD;            (* User flags        *)
  169.                          user_fmt    : BYTE;            (* Format of "L"     *)
  170.                          max_pac     : WORD;            (* Maximum packet siz*)
  171.                          user_last   : LONGINT;         (* Last time on      *)
  172.                          user_l_time : LONGINT;         (* Last time "L" done*)
  173.                          user_l_cnt  : WORD;            (* Number of logons  *)
  174.                          user_n_time : LONGINT;         (* Last time "N" done*)
  175.                          user_pw     : password_str;    (* Password          *)
  176.                          user_sysop_p: BYTE;            (* SYSOP password #  *)
  177.                          user_lang   : CHAR;            (* User language     *)
  178.                          user_scr_len: BYTE;            (* Length of user's  *)
  179.                                                         (*      screen       *)
  180.                          user_scr_wid: BYTE;            (* Width of user's   *)
  181.                                                         (*      screen       *)
  182.                          user_access : access_block_type;(* User access  lvl *)
  183.                          padding     : ARRAY[1..4] OF BYTE;
  184.                        END;
  185.  
  186.  
  187. BBOPT.BB
  188. --------
  189.  
  190. This file contains the options information.  The first record is the
  191. main option block followed by the port blocks and then the file blocks.
  192. Each record is 4096 bytes long.  This file changes format a lot but
  193. the file control blocks have been fairly constant.
  194.  
  195. --- First block ---
  196.  
  197.         port_count         : BYTE;      (* Number of ports                   *)
  198.         fd_count           : BYTE;      (* Number of file directories        *)
  199.  
  200.         opt_type_bpt       : BOOLEAN;   (*  Limit types to B, P, and T       *)
  201.         opt_sysop_is_in    : BOOLEAN;   (* Sysop is accepting calls          *)
  202.         opt_sysop_bell     : BOOLEAN;   (* Sysop bell is on                  *)
  203.         opt_bid_for_p      : BOOLEAN;   (* Gen BID for P messages            *)
  204.         opt_bid_for_t      : BOOLEAN;   (* Gen BID for T messages            *)
  205.         opt_bid_for_blank  : BOOLEAN;   (* Gen BID for _ messages            *)
  206.         opt_blank_to_p     : BOOLEAN;   (* Translate "S" to "SP"             *)
  207.         opt_blank_to_b     : BOOLEAN;   (* Translate "S" to "SB"             *)
  208.         opt_hold_dupe_bid  : BOOLEAN;   (* Hold duplicate bids               *)
  209.         opt_kill_bbs_error : BOOLEAN;   (* Disconnect BBS on any error       *)
  210.         opt_direct_display : BOOLEAN;   (* Write direct to display           *)
  211.         opt_direct_snow    : BOOLEAN;   (* Avoid snow on CGA                 *)
  212.         opt_rename_k       : BOOLEAN;   (* Rename killed                     *)
  213.         opt_error          : BOOLEAN;   (* Log minor errors                  *)
  214.         opt_mono_tcb_trace : BOOLEAN;   (* Special monochrome TCB trace      *)
  215.         opt_trace          : BOOLEAN;   (* Run trace                         *)
  216.         opt_mon_time_stamp : BOOLEAN;   (* Time stamp monitor data           *)
  217.         opt_bbs_see_p      : BOOLEAN;   (* Allow BBS to see "P" messages     *)
  218.         opt_already_conn   : BOOLEAN;   (* Duplicate connect check           *)
  219.         opt_time_status    : BOOLEAN;   (* Update status line on time tick   *)
  220.         opt_own_in_bcst    : BOOLEAN;   (* Own call in BCST                  *)
  221.         opt_yapp_state     : BOOLEAN;   (* Show YAPP states                  *)
  222.         opt_show_binary    : BOOLEAN;   (* Show binary data during s/r       *)
  223.         opt_suppress_pfx   : BOOLEAN;   (* Don't show prefix on LO screen    *)
  224.         opt_show_mismatch  : BOOLEAN;   (* Show mismatch during forward scrpt*)
  225.         opt_auto_hlookup   : BOOLEAN;   (* Do HLOOKUP each forward cycle     *)
  226.         opt_extend_timeout : BOOLEAN;   (* Extend timeout on ports           *)
  227.         opt_personal_bbs   : BOOLEAN;   (* Personal BBS                      *)
  228.         opt_no_alt_header  : BOOLEAN;   (* Alternate header                  *)
  229.         opt_send_sid_alwys : BOOLEAN;   (* Always send SID                   *)
  230.         opt_fill_blank_bbs : BOOLEAN;   (* If @ BBS is blank fill from user  *)
  231.         opt_no_lang_prompt : BOOLEAN;   (* Language prompt control in registr*)
  232.         opt_no_full_review : BOOLEAN;   (* If on, bypass full screen review  *)
  233.         opt_blank_to_bbs   : BOOLEAN;   (* If on, set the default to bbs = ''*)
  234.         opt_autoset_to_bbs : BOOLEAN;   (* If on, set the default to bbs to  *)
  235.                                         (* that user's home BBS if any       *)
  236.  
  237.         operate_mode  : op_mode;        (* Operation mode                    *)
  238.         max_task_no   : BYTE;           (* Maximum number of tasks           *)
  239.         this_bb_sign  : call_sign_str;  (* Call sign of BBS                  *)
  240.         this_bb_bid   : call_sign_str;  (* Call sign of BBS for bid purposes *)
  241.         sysop_sign    : call_sign_str;  (* Call sign of SYSOP                *)
  242.         this_bb_addr  : bb_addr_str;    (* Address of BBS                    *)
  243.         this_bb_h     : h_addr_str;     (* Hieararchical addess of this BBS  *)
  244.         this_bb_name  : STRING[15];     (* SYSOP name                        *)
  245.         this_bb_loc   : STRING[25];     (* Location                          *)
  246.         user_file_name: file_name_str;  (* USER control file                 *)
  247.         msg_file_name : file_name_str;  (* MSG control file                  *)
  248.         msg_file_dir  : file_name_str;  (* Directory for the msg files       *)
  249.         mess_fn       : file_name_str;  (* File name for messages            *)
  250.         dos_mess_fn   : file_name_str;  (* File name for DOS messages        *)
  251.         route_fn      : file_name_str;  (* File name for route table         *)
  252.         path_fn       : file_name_str;  (* File name for path table          *)
  253.         log_fn        : file_name_str;  (* File name for log                 *)
  254.         help_fn       : file_name_str;  (* File name for help                *)
  255.         doserr_fn     : file_name_str;  (* File name for DOS error messages  *)
  256.         mon_fn        : file_name_str;  (* File name for monitor log         *)
  257.         wakeup_fn     : file_name_str;  (* File name for wakeup              *)
  258.         hlook_fn      : file_name_str;  (* File name for hlookup             *)
  259.         passwd_fn     : file_name_str;  (* File name for password file       *)
  260.         action_fn     : file_name_str;  (* File name for action file         *)
  261.         n_mon         : WORD;           (* Number of mon items to keep       *)
  262.         bid_fn        : file_name_str;  (* File name for bid table           *)
  263.         n_bid         : WORD;           (* Number of bid items to keep       *)
  264.         n_j_list      : BYTE;           (* Number of items on j list         *)
  265.         hold_dupe_hdr : BYTE;           (* Number of dup headers to hold     *)
  266.         trace_file_name : file_name_str;  (* Trace output                    *)
  267.         z_time_bbs    : LONGINT;        (* Timezone correction -- BBS        *)
  268.         z_time_fwd    : LONGINT;        (* Timezone correction -- FWD        *)
  269.         nofwd_kill    : STRING[26];     (* Dont kill on forward              *)
  270.         bcst_interval : BYTE;           (* Broadcast interval in minutes     *)
  271.         disc_delay    : BYTE;           (* Disconnect delay                  *)
  272.         fwd_delay     : BYTE;           (* Forward delay                     *)
  273.         opt_types     : STRING[27];     (* Allowed types                     *)
  274.         emer_types    : STRING[27];     (* Emergency types                   *)
  275.         operator_color: BYTE;           (* Color of operator stuff           *)
  276.         status_color  : BYTE;           (* Color of staus line               *)
  277.         window_percent: BYTE;           (* Window split percentage           *)
  278.         scroll_mon    : WORD;           (* Monitor scroll                    *)
  279.         scroll_opr    : WORD;           (* Operator scroll                   *)
  280.         scroll_conn   : WORD;           (* Connect scroll                    *)
  281.         editor_free   : WORD;           (* Editor free size                  *)
  282.         bell_length1  : BYTE;           (* Tone length                       *)
  283.         bell_length2  : BYTE;           (* Warble length                     *)
  284.         max_headers   : BYTE;           (* Maximum number of headers         *)
  285.         max_messages  : BYTE;           (* Maximum number of messages in stor*)
  286.         newuser_l_time: BYTE;           (* How many days to show a new user  *)
  287.  
  288.         wp_bb_sign    : bb_full_addr;   (* Call sign of WP system to send to *)
  289.         home_expires  : LONGINT;        (* When Home BBS expires             *)
  290.         b_fwd_stop    : LONGINT;        (* Don't forward bulletins after     *)
  291.                                         (* this time period                  *)
  292.         dflt_b_expire : LONGINT;        (* Default bulletin expiration date  *)
  293.         language_list : lang_str;       (* List of allowed languages         *)
  294.  
  295.         parm_file_ver : BYTE;           (* Version number of parm file       *)
  296.  
  297. --- Port block ---
  298.  
  299.     port_type_type  = (port_dedhost1,    (* DED host mode -- TNC1            *)
  300.                        port_dedhost2,    (* DED host mode -- TNC2            *)
  301.                        port_dedhost87,   (* DED host mode -- PK-87           *)
  302.                        port_bpqhost,     (* DED host mode -- BPQ switch      *)
  303.                        port_pcpa,        (* DRSI PC*PA                       *)
  304.                        port_aeapk232,    (* AEA PK-232 mode                  *)
  305.                        port_g8bpq,       (* G8BPQ switch                     *)
  306.                        port_pc1xx,       (* Paccom PC-1xx                    *)
  307.                        port_modem,       (* Modem with AT command set        *)
  308.                        port_serial,      (* Dumb serial port                 *)
  309.                        port_unknown);    (* Not set                          *)
  310.  
  311.     port_block_type = RECORD
  312.                         next_port   : port_block_ptr;   (* -> next block     *)
  313.                         main_port   : port_block_ptr;   (* -> main port      *)
  314.                         rel_port    : port_block_ptr;   (* -> related port   *)
  315.                         aux_thread  : tcb_ptr;          (* Monitor thread    *)
  316.                         com_number  : BYTE;             (* COMx number       *)
  317.                         port_char   : CHAR;             (* Character for port*)
  318.                         port_name   : STRING[20];       (* Name of port      *)
  319.                         port_type   : port_type_type;   (* Port type         *)
  320.  
  321.                         port_host_only      : BOOLEAN;  (* Host mode only tnc*)
  322.                         port_sub_port       : BOOLEAN;  (* Sub port (PC*PA)  *)
  323.                         port_monitor        : BOOLEAN;  (* Monitor this port?*)
  324.                         port_r_sysop        : BOOLEAN;  (* Remote sysop ok   *)
  325.                         port_up_down        : BOOLEAN;  (* Upload/Download ok*)
  326.                         port_bcst           : BOOLEAN;  (* Bcst on this port *)
  327.                         port_pk232_data_ack : BOOLEAN;  (* PK232 dat ack wait*)
  328.                         port_no_out_fwd     : BOOLEAN;  (* No outgoing fwd   *)
  329.                         port_no_busy_fwd    : BOOLEAN;  (* No outgoing fwd   *)
  330.                                                         (* when busy         *)
  331.                         port_no_binary      : BOOLEAN;  (* No binary allowed *)
  332.                         port_use_user_chan  : BOOLEAN;  (* User user channel *)
  333.                                                         (* for forwarding    *)
  334.                         port_dflt_trans     : BOOLEAN;  (* Default transpart *)
  335.  
  336.  
  337.                         port_operate_mode : op_mode;    (* Operation mode    *)
  338.                         port_num    : CHAR;             (* PCPA port #       *)
  339.                         port_color  : BYTE;             (* Display color     *)
  340.                         port_sema   : BYTE;             (* Semaphore number  *)
  341.                         port_no_mail_bcst : BYTE;       (* Bdcst with no mail*)
  342.                         port_no_mail_cnt  : BYTE;       (* Count of no mail  *)
  343.                         port_allow  : user_class_type;  (* Allow this class  *)
  344.                         dflt_pac    : WORD;             (* Default packet siz*)
  345.                         max_pac     : WORD;             (* Max packet size   *)
  346.                         data_rate   : WORD;             (* Data rate to use  *)
  347.                         time_out    : WORD;             (* Time out in second*)
  348.                         fwd_min     : WORD;             (* Forward minute    *)
  349.                         sked_fwd    : LONGINT;          (* Next time to fwd  *)
  350.                         max_conn    : BYTE;             (* Num of connects   *)
  351.                         max_chan    : BYTE;             (* Max capacity TNC  *)
  352.                         port_pend   : BYTE;             (* Maximum port pend *)
  353.                         dflt_scrl   : BYTE;             (* Default screen len*)
  354.                         reject_act  : BYTE;             (* Reject action     *)
  355.                         dflt_lang   : CHAR;             (* Default language  *)
  356.                         dflt_access : access_block_type;(* Default access    *)
  357.                         first_load  : file_name_str;    (* File to load      *)
  358.                         dflt_order  : STRING[3];        (* Default fwd order *)
  359.                         connected   : port_connect_ptr; (* List of connects  *)
  360.                         call_list   : port_call_ptr;    (* list of calls hrd *)
  361.                         CASE BYTE OF
  362.  
  363.                           0 :                           (* All ports but modm*)
  364.                               (call_set  : STRING[9];   (* Set this call     *)
  365.                                bcst_path : STRING[45]); (* Bcst this path    *)
  366.  
  367.                           1:                            (* Modem ports       *)
  368.                               (modem_optns : BYTE;      (* Signify modem opt *)
  369.                                answer_ring : BYTE;      (* Answer on this rin*)
  370.                                cr_timeout  : BYTE;      (* CR time out       *)
  371.                                cur_rate    : WORD;      (* Current data rate *)
  372.                                modem_echo  : BOOLEAN;   (* Echo on modem     *)
  373.                                modem_e_now : BOOLEAN;   (* Echo on modem NOW *)
  374.                                modem_crlf  : BOOLEAN;   (* CR=CR/LF for modem*)
  375.                                modem_dial  : BOOLEAN;   (* Modem dialing     *)
  376.                                modem_conn  : BOOLEAN;   (* Modem connect msg *)
  377.                                modem_freez : BOOLEAN;   (* Freeze modem speed*)
  378.                                port_modem_dcd : BOOLEAN); (* DCD on modem    *)
  379.  
  380. --- File block ---
  381.  
  382.   TYPE
  383.     fsb_name_str          = STRING[10];
  384.  
  385.     fsb_ptr               = ^file_subsys_block;
  386.  
  387.     file_subsys_block     = RECORD
  388.                               next_fsb        : fsb_ptr;
  389.                               fsb_name        : fsb_name_str;
  390.                               fsb_alias       : STRING[60];
  391.                               fsb_desc        : STRING[60];
  392.                               fsb_path        : file_name_str;
  393.                               fsb_f_subdir_ok : BOOLEAN;
  394.                               fsb_binary      : BOOLEAN;
  395.                               fsb_up          : user_class_type;
  396.                               fsb_down        : user_class_type;
  397.                             END;
  398.  
  399.  
  400. ----
  401.  
  402. This is the access control block as used by the user and port records
  403.  
  404. TYPE
  405.   access_block_type  = RECORD
  406.                          access_flags : BYTE;
  407.                        END;
  408.  
  409. (*---------------------------------------------------------------------------*)
  410. (* Access flags                                                              *)
  411. (*---------------------------------------------------------------------------*)
  412.  
  413. CONST
  414.  
  415.   access_f_sysop     = $80;    (* User authentication as remote sysop requird*)
  416.   access_f_bbs       = $40;    (* User authentication as BBS required        *)
  417.   access_f_user      = $20;    (* User authentication required               *)
  418.   access_f_user_send = $10;    (* User authentication required for send      *)
  419.  
  420.   access_letter_group : str4
  421.                      = 'RBAS'; (* Letters representing each flag in order    *)
  422.  
  423.